﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ht_sanpham.aspx.cs" Inherits="Andy.Web.admin.ht_sanpham" EnableEventValidation="false" %>
<%@ Register TagPrefix="cc1" Namespace="Vdc.Grid" Assembly="vdc_Grid_NET" %>
<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <script type="text/javascript">
        function updateGrid(gridRows) {
            //update to DB
            var records = "";
            for (var i = 0; i < gridRows.length; i++) {
                records += gridRows[i].Cells[0].Value + "-" + gridRows[i].Cells[1].Value + ",";
            }
            alert(records);
            return false;
        }
        </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <cc1:Grid ID="grid1" runat="server" CallbackMode="true" Serialize="true" AllowAddingRecords="true" PageSize="-1"
                         AutoGenerateColumns="false" AllowRecordSelection="false" AllowMultiRecordSelection="false" Width="100%"
                         ShowFooter="true" AllowSorting="false" AllowPaging="false" AllowPageSizeSelection="false" OnRowDataBound="grid1_RowDataBound" >
                        <PagingSettings ShowRecordsCount="false" />
                        <TemplateSettings NewRecord_TemplateId="ButtonsTemplate" />
                        <Columns>
                            <cc1:Column ID="Column1" DataField="CheckNoiBat" ReadOnly="true" HeaderText="Nổi bật" runat="server">
                                <TemplateSettings TemplateId="TemplateWithCheckbox" />
                            </cc1:Column>
                            <cc1:Column ID="Column2" DataField="Id" HeaderText="ID" runat="server" />
                        </Columns>
                        <Templates>
                            <cc1:GridTemplate runat="server" ID="TemplateWithCheckbox">
                                <Template>
                                    <asp:CheckBox runat="server" ID="ChkID" ToolTip="<%# Container.Value %>" Checked="<%# Convert.ToBoolean(Container.Value) %>" />
                                    <asp:HiddenField runat="server" ID="ProductName" Value='<%# Container.DataItem["Id"] %>' />
                                </Template>
                            </cc1:GridTemplate>
                            <cc1:GridTemplate runat="server" ID="ButtonsTemplate">
                                <Template>
                                    <asp:Button ID="VdcButton1" runat="server" Text="Add New Row" OnClick="VdcButton1_Click"></asp:Button>
                                </Template>
                            </cc1:GridTemplate>
                        </Templates>
                    </cc1:Grid>

        <ul class="pages clearfix">
                        <asp:Literal ID="ltlPhanTrang" runat="server"></asp:Literal>
         </ul>
    </div>
    </form>
</body>
</html>
